//
//  DWUIViewController.m
//  OCAPPDemo
//
//  Created by 杨冬武 on 2021/6/5.
//

#import "DWUIViewController.h"
#import <Masonry/Masonry.h>
#import "DWOneView.h"
#import "DWUIOneViewController.h"

@interface DWUIViewController ()

@end

@implementation DWUIViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSLog(@"%s", __FUNCTION__);
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    DWOneView *oneView = [[DWOneView alloc] init];
    oneView.backgroundColor = [UIColor redColor];
    UIView *subview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
    [oneView addSubview:subview];
    [self.view addSubview:oneView];
    oneView.frame = CGRectMake(100, 300, 200, 100);
    
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    DWUIOneViewController *oneVC = [[DWUIOneViewController alloc] init];
    [self.navigationController pushViewController:oneVC animated:YES];
}

#pragma mark - 生命周期方法

- (void)loadView {
    [super loadView];
    NSLog(@"%s", __FUNCTION__);
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    NSLog(@"%s", __FUNCTION__);
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    NSLog(@"%s", __FUNCTION__);
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    NSLog(@"%s", __FUNCTION__);
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    NSLog(@"%s", __FUNCTION__);
}

- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    NSLog(@"%s", __FUNCTION__);
}

- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
    NSLog(@"%s", __FUNCTION__);
}

+ (instancetype)alloc {
    NSLog(@"%s", __FUNCTION__);
    return [super alloc];
}


- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    NSLog(@"%s", __FUNCTION__);
    return [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
}

- (instancetype)initWithCoder:(NSCoder *)coder {
    NSLog(@"%s", __FUNCTION__);
    return [super initWithCoder:coder];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    NSLog(@"%s", __FUNCTION__);
}

- (instancetype)init {
    NSLog(@"%s", __FUNCTION__);
    return [super init];
}

- (void)dealloc {
    NSLog(@"%s", __FUNCTION__);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    NSLog(@"%s", __FUNCTION__);
}

@end
